<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 5.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<!--common-->
  <link href="css/style.css" rel="stylesheet">
  <link href="css/style-responsive.css" rel="stylesheet">
  <link href="css/stuInfoManage/main.css" rel="stylesheet">
  <link href="css/stuInfoManage/stuInfoUpdate.css" rel="stylesheet">
  
<title>Insert title here</title>
<script type="text/javascript">
	
	//检查邮箱
	function checkEmail(obj) {
		var temp = $.trim(obj.value);
		if(temp != ""){
			var email=/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
			if(!email.test(temp)){
    			$("#emailTip").html("<font color='red'>邮箱格式不正确</font>");
    		}else{
    			$.ajax({
    				url:"${pageContext.request.contextPath }/isAlreadyExistOfStuInfo",
    				type:"post",
    				data:{
    					sEmail:temp,
    				},
    				success:function(result){
    					if(result.length > 0){
    						$("#emailTip").html("<font color='red'>邮箱已注册!</font>");
    					}else{
    						$("#emailTip").html("<font color='green'>邮箱可用</font>");
    					}
    				}
    			});
    		}
		}else{
			 $("#emailTip").html("<font color='red'>邮箱不能为空</font>");
		}
	}
</script>
<script src="js/common.js"></script>
</head>
<body class="sticky-header">
<section>
	<!-- 导入左边菜单栏 -->
    <%--  <%@include file="common/sidebarStart.jsp" %>--%>
    
    		<li class="menu-list nav-active"><a href=""><i class="fa fa-book"></i> <span>学生信息管理</span></a>
               <ul class="sub-menu-list">
                   <li><a href="infoManage"> 信息管理页面</a></li>
                   <li class="active"><a href="infoUpdate?flag=1"> 信息修改界面</a></li>
                   <li><a href="infoAdd?flag=1"> 信息添加界面</a></li>
                   <li><a href="infoSelect?flag=1"> 信息查询界面</a></li>
               </ul>
           </li>

           <li class="menu-list"><a href=""><i class="fa fa-tasks"></i> <span>学生成绩管理</span></a>
               <ul class="sub-menu-list">
                   <li><a href="form_layouts.html"> 成绩管理界面</a></li>
                   <li><a href="form_advanced_components.html"> 成绩修改界面</a></li>
                   <li><a href="form_wizard.html"> 成绩添加界面</a></li>
                   <li><a href="form_validation.html"> 成绩查询界面</a></li>
               </ul>
           </li>
           
           <li class="menu-list"><a href="#"><i class="fa fa-th-list"></i> <span>发布通知</span></a>
               <ul class="sub-menu-list">
                   <li><a href="basic_table.html"> 网站发布公告 </a></li>
                   <li><a href="dynamic_table.html">单独发给学生 </a></li>
                   <li><a href="responsive_table.html"> 群发班级通知</a></li>
                   <li><a href="editable_table.html"> 群发每个学生</a></li>
               </ul>
           </li>
           
           
     <%@include file="common/sidebarEnd.jsp" %>
    <!-- 主内容开始-->
	<div class="main-content" >	
		<!-- 通知菜单栏 -->
		<%@include file="common/notifyMenu.jsp" %>
		
		<div class="container">
        <div class="row"><c:if test="${requestScope.msg != null}"><script type="text/javascript">alert('${requestScope.msg}')</script></c:if>
            <div class="col-sm-4"></div>
            <div class="col-sm-4">
            <div class="little-title">学生信息修改界面</div>
                <form method="post" class="form-horizontal" role="form" action="infoUpdate?flag=2">
                    <div class="form-group">
					    <label for="sName" class="col-sm-2 control-label">姓&nbsp;&nbsp;&nbsp;&nbsp;名:</label>
					    <div class="col-sm-7">
					      <input type="text" class="form-control " id="sName" name="sName" value="${ student.sName}" required="required" onblur="checkName(this)"/>
					    </div>
					    <div id="nameTip"></div>
					 </div>
					 
                    <div class="form-group">
					    <label for="text" class="col-sm-2 control-label">密&nbsp;&nbsp;&nbsp;&nbsp;码:</label>
					    <div class="col-sm-7">
					      <input type="password"  class="form-control " id="sPassword" name="sPassword" value="${student.sPassword }" required="required" onKeyUp="javascript:AuthPasswd(this);"/>
					    </div>
					    <div class="col-sm-3">
			                <div id="weak" style="width:100%"> </div>
			                <div id="middle" style="width:100%"> </div> 
				          	<div id="strength" style="width:100%"> </div>
		          		</div>
					 </div>
					 
                    <div class="form-group">
					    <label for="email" class="col-sm-2 control-label">邮&nbsp;&nbsp;&nbsp;&nbsp;箱:</label>
					    <div class="col-sm-7">
					      <input type="email" class="form-control " id="sEmail" name="sEmail" value="${student.sEmail }" required="required" onblur="checkEmail(this)"/>
					    </div>
					    <div id="emailTip"></div>
					</div>
					
                    <div class="form-group">
					    <label for="radio" class="col-sm-2 control-label"><span style="font-weight: bold; ">性&nbsp;&nbsp;&nbsp;&nbsp;别:</span></label>
					    <div class="col-sm-9">
					      <div class="radio">
							  <label class="checkbox-inline">
							    <input type="radio" name="sSex" value="男" 
							    	<c:if test="${requestScope.student.sSex == '男'}">
							    		checked="checked"
							    	</c:if>
							    >男
							  </label>
							   <label class="checkbox-inline">
								    <input type="radio" name="sSex" value="女" 
								    <c:if test="${requestScope.student.sSex == '女'}">
							    		checked="checked"
							    	</c:if>
								    >女
							 </label>
						  </div>
					    </div>
					</div>
                    <button class="btn btn-primary btn-block">提交</button>
                    <input type="hidden"  name="sId"  value="${sId}"/>
                </form>
            </div>
            <div class="col-sm-4"></div>
        </div>
       </div>
		
    </div>
    <!-- 主内容结束-->
</section>

<!-- Placed js at the end of the document so the pages load faster -->
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="js/jquery-migrate-1.2.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/modernizr.min.js"></script>
<script src="js/jquery.nicescroll.js"></script>

<!--页面公共脚步-->
<script src="js/scripts.js"></script>


</body>
</html>